package com.example.mydefinedview1.ui

import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View

/**
 *
 * @Author： LJH
 * @Time： 2022/6/29
 * @description：
 */
class ArcView(context: Context, attr:AttributeSet?):View(context,attr) {
    private val paint = Paint()
    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        //练习内容：使用 canvas.drawArc() 方法画弧形和扇形
        canvas?.drawArc(260F,90F,450F,230F,-110F,100F,true,paint)
        canvas?.drawArc(240F,100F,450F,220F, 20F, 140F,false,paint)
        paint.style = Paint.Style.STROKE
        canvas?.drawArc(240F,100F,450F,220F, 176F, 68F,false,paint)
    }
}